<!DOCTYPE html>
<html lang="zh_CN">
<head>
	<link rel="stylesheet" href="/static/editormd/css/editormd.min.css" />
	
	<script src="/static/js/jquery.min.js"></script>
	<script src="/static/editormd/editormd.min.js"></script>
	<script src="/static/js/publish-dialog.js"></script>
	<script type="text/javascript">
	    $(function() {
	    	var loadicon = true;
	    	$('#editormd textarea').val( window.localStorage.getItem('youmd_content') );
	        var editor = editormd("editormd", {
                width: "90%",
                height: 700,
                emoji : true,	//www.emoji-cheat-sheet.com
                taskList : true,
                tocm : true,         // Using [TOCM]
                tex : true,                   // 开启科学公式TeX语言支持，默认关闭		http://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.css

                flowChart : true,             // 开启流程图支持，默认关闭
                sequenceDiagram : true,       // 开启时序/序列图支持，默认关闭,
                
	            path : "/static/editormd/lib/", // Autoload modules mode, codemirror, marked... dependents libs path
	            
	            imageUpload : true,
	            imageFormats : ["jpg", "jpeg", "gif", "png", "bmp"],
	            imageUploadURL : "./upload",

                onchange : function() {
                	window.localStorage.setItem("youmd_content",this.getValue());
                },
                onload : function(){
                        this.fullscreen();
                },
                toolbarIcons : function() {
                	if (loadicon){
                		window.editormd.toolbarModes.full.push("||", "publish");
                		loadicon = false;
                		}
                	return window.editormd.toolbarModes.full;
                },
		        toolbarIconTexts : {
		            publish : "一键发布"  // 如果没有图标，则可以这样直接插入内容，可以是字符串或HTML标签
		        },
		        lang : {
		            toolbar : {
		                publish : "发布到博客服务端存储",
		            }
		        },
		        toolbarHandlers : {
		        	publish : function(cm, icon, cursor, selection) {
		        		this.publishDialog();
		        		//this.executePlugin("publishDialog", "publish-dialog");
		        	}
		        }

	        });
	
	        /*
	        // or
	        var editor = editormd({
	            id   : "editormd",
	            path : "../lib/"
	        });
	        */
	    });
	</script>
	
</head>
<body>
	<div id="editormd">
	    <textarea style="display:none;">### Hello Editor.md !</textarea>
	</div>
</body>
</html>